package com.md.dao;

import com.md.entity.DeptInfo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface UserDao {
    @Select("select * from deptinfo")
    List<DeptInfo> selectAllDept();
    @Delete("delete from deptinfo where did = #{id}")
    int deleteUserById(int id);
    @Select("select * from deptinfo where did = #{id}")
    DeptInfo selectUserById(int id);
    @Insert("insert into deptinfo(dname) values (#{dname})")
    int insertUser(DeptInfo deptInfo);
    @Update("update deptinfo set dname = #{dname} where did = #{did}")
    int updateone(DeptInfo deptInfo);
}
